import { t } from '@src/locales'

enum ProductTypeRelationProductFieldMappingEnum {
  Name = 'productName',
  DisplayName = 'displayName',
  ModifyBeforeValue = 'oldValue',
  ModifyAfterValue = 'newValue',
}

const QualityInfoFieldNameToDisplayNameMap: Record<string, any> = {
  qualityStartTime: t('common.quality.qualityStartTime'),
  qualityEndTime: t('common.quality.qualityEndTime'),
  qualityCalculation: t('common.quality.qualityCalculation'),
  qualityStatus: t('common.quality.qualityStatus'),
}

const QualityInfoTypeDisplayNameMap: Record<string, any> = {
  AUTO: t('common.quality.type.auto'),
  MANUAL: t('common.quality.type.manual')
}

const QualityInfoTypeMap: Record<string, any> = {
  AUTO: 'AUTO',
  MANUAL: 'MANUAL'
}

const ProductTypeRelationProductListTableListColumns = [
  {
    "label": t('common.fields.productName.displayName'),
    "field": "productName",
    "show": true,
    "fixed": false,
    "width": "250px",
    "type": "column"
  },
  {
    "label": t('common.fields.modifyField.displayName'),
    "field": "displayName",
    "show": true,
    "fixed": false,
    "width": "250px",
    "type": "column",
  },
  {
    "label": t('common.fields.beforeModify.displayName'),
    "field": "oldValue",
    "formType": "date",
    "show": true,
    "fixed": false,
    "width": "250px",
    "type": "column",
  },
  {
    "label": t('common.fields.afterModify.displayName'),
    "field": "newValue",
    "formType": "date",
    "show": true,
    "fixed": false,
    "width": "250px",
    "type": "column",
  }
]

export {
  ProductTypeRelationProductListTableListColumns,
  ProductTypeRelationProductFieldMappingEnum,
  QualityInfoFieldNameToDisplayNameMap,
  QualityInfoTypeDisplayNameMap,
  QualityInfoTypeMap
}